﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<skags.Models.Child>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Breyta barni
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="navigation">
<% Html.RenderPartial("IndexNavigation"); %>
</div>
<div id="content">

    <h2>Breyta barni</h2>

    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>
        <div>
        <fieldset>
                <legend>Upplýsingar um barnið</legend>
                <div class="editor-label">
                    Nafn:
                </div>
                <div class="editor-field">
                    <%: Html.TextBoxFor(m => m.Name)%>
                    <%: Html.ValidationMessageFor(m => m.Name)%>
                </div>
                
                <div class="editor-label">
                     Kyn:
                </div>
                <div class="editor-field"> 
                    <!-- Athugið að strákar fá gildið "True" og stelpur gildið "False" -->
                    Strákur: <%: Html.RadioButtonFor(x => x.Sex, "True") %>
                    Stelpa: <%= Html.RadioButtonFor(x => x.Sex, "False") %>
                    <%: Html.ValidationMessageFor(m => m.Sex)%>
                </div>
                <br />
                <div class="editor-label">
                     Lýsing:
                </div>
                <div class="editor-field">
                    <%: Html.TextAreaFor(m => m.Description) %>
                    <%: Html.ValidationMessageFor(m => m.Description)%>
                </div>
                <div class="editor-label">
                     Fæðingardagur:
                </div>
                <div>
                    <%: Html.TextBoxFor(m => m.BirthDate)%>
                    <%: Html.ValidationMessageFor(m => m.BirthDate)%>
                </div>
                <script type="text/javascript">
                    $(function () {
                        $.datepicker.setDefaults($.datepicker.regional['is']);
                        $.datepicker.setDefaults({ dateFormat: 'dd/mm/yy' });
                        $("#BirthDate").datepicker({ changeYear: true });
                        $("#BirthDate").datepicker();
                    });
                </script>
                <p>
                <input type="submit" value="Vista" />
            </p>
            </fieldset>
        </div>

    <% } %>

    <div>
        <%: Html.ActionLink("Til Baka", "ChildList") %>
    </div>

</asp:Content>

